<template>
  <el-dialog  :visible.sync="isShow" center class="earnings-reward" append-to-body width="60%">
    <el-table class="detail-table" :data="rewardData" border max-height="350" style="width: 100%" ref="table">
      <el-table-column prop="reason" label="原因" show-overflow-tooltip min-width="140"></el-table-column>
      <el-table-column prop="reward" label="金额" show-overflow-tooltip min-width="140"></el-table-column>
    </el-table>
  </el-dialog>
</template>

<script>
export default {
  data () {
    return {
      isShow:false,
      rewardData: [],
      settlement_id: null
    }
  },
  methods: {
    show(data) {
      this.settlement_id = data.id;
      this.getInfo();
      this.isShow = true;
    },
    getInfo() {
      this.$axios.get(`api/settlement/${this.settlement_id}`).then(res => {
        if (res.data.code == 200) {
          let data = res.data.data
            if (data.final && data.final.settlement_reward_record) {
              this.rewardData = data.final.settlement_reward_record
            } else {
              this.$alert('该案件暂无奖励详情', "提示", {
                confirmButtonText: "确定",
                center: true,
                type: "warning",
                callback: action => {}
              });
            }
        } else {
          this.$alert(res.data.message, "提示", {
            confirmButtonText: "确定",
            center: true,
            type: "warning",
            callback: action => {}
          });
        }
      });
    },
    // refresh() {
    //   this.isShow = false;
    //   this.$emit("refresh");
    // },
  }
}
</script>

<style lang='less'>
  .earnings-reward {

  }
</style>